import { createApp } from 'vue'
import App from './App.vue'
import router from './router/'
// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import Vant from 'vant'; // 导入 Vant 所有的组件
import 'vant/lib/index.css'; // 引入 Vant 的样式
import { loadStyle } from './utils/loadStyle'


// 动态加载阿里云字体库
let iconfontVersion = ['3346752_19fsz3qsewt'];
const iconfontUrl = `//at.alicdn.com/t/c/font_4686524_ar9d5qy70u.css`
iconfontVersion.forEach(ele => {
    console.log(iconfontUrl.replace("$key", ele));
    loadStyle(iconfontUrl.replace("$key", ele));
});

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}

app.use(router)
app.use(Vant)
app.mount("#app")